package com.conceal.client.utils;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.EndpointConfig;

/**
 * 最简单的websocket字符串解码器
 *
 *
 */
public class StringDecoder implements Decoder.Text<String> {

    @Override
    public String decode(String s) throws DecodeException {
        return new String(s);
    }

    @Override
    public boolean willDecode(String s) {
        return (s != null);
    }

    @Override
    public void init(EndpointConfig endpointConfig) {
        // do nothing
    }

    @Override
    public void destroy() {
        // do nothing
    }
}
